package com.yuedao.sender.model1;

import javax.persistence.*;

/**
 * AssistDemo
 * com.chris.demo.model.orm
 * Created by Chris Chen
 * 2018/1/5
 * Explain:
 */
@Entity(name = "ydx_vehicle_models")
public class VehicleModelEntity {
    private int id;
    private String brand;
    private String model;
    private String color;
    private Integer passengerSize;
    private Integer trunkSize;
    private Integer available;
    private String description;
    private Integer vehicleTypeId;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "brand", nullable = false, length = 16)
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    @Basic
    @Column(name = "model", nullable = false, length = 16)
    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    @Basic
    @Column(name = "color", nullable = true, length = 16)
    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Basic
    @Column(name = "passenger_size", nullable = true)
    public Integer getPassengerSize() {
        return passengerSize;
    }

    public void setPassengerSize(Integer passengerSize) {
        this.passengerSize = passengerSize;
    }

    @Basic
    @Column(name = "trunk_size", nullable = true)
    public Integer getTrunkSize() {
        return trunkSize;
    }

    public void setTrunkSize(Integer trunkSize) {
        this.trunkSize = trunkSize;
    }

    @Basic
    @Column(name = "available", nullable = true)
    public Integer getAvailable() {
        return available;
    }

    public void setAvailable(Integer available) {
        this.available = available;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 2048)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "vehicle_type_id", nullable = true)
    public Integer getVehicleTypeId() {
        return vehicleTypeId;
    }

    public void setVehicleTypeId(Integer vehicleTypeId) {
        this.vehicleTypeId = vehicleTypeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        VehicleModelEntity that = (VehicleModelEntity) o;

        if (id != that.id) return false;
        if (brand != null ? !brand.equals(that.brand) : that.brand != null) return false;
        if (model != null ? !model.equals(that.model) : that.model != null) return false;
        if (color != null ? !color.equals(that.color) : that.color != null) return false;
        if (passengerSize != null ? !passengerSize.equals(that.passengerSize) : that.passengerSize != null)
            return false;
        if (trunkSize != null ? !trunkSize.equals(that.trunkSize) : that.trunkSize != null) return false;
        if (available != null ? !available.equals(that.available) : that.available != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (vehicleTypeId != null ? !vehicleTypeId.equals(that.vehicleTypeId) : that.vehicleTypeId != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (brand != null ? brand.hashCode() : 0);
        result = 31 * result + (model != null ? model.hashCode() : 0);
        result = 31 * result + (color != null ? color.hashCode() : 0);
        result = 31 * result + (passengerSize != null ? passengerSize.hashCode() : 0);
        result = 31 * result + (trunkSize != null ? trunkSize.hashCode() : 0);
        result = 31 * result + (available != null ? available.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (vehicleTypeId != null ? vehicleTypeId.hashCode() : 0);
        return result;
    }
}
